<template>
	<view class="box">
		<view class="setting-box">
			<view  class="setting-list flex flai fljcsb" @click="bindMobile()">
				<view class="setting-title">
					手机号
				</view>
				<view class="setting-con flex flai" >
					<text v-if="infos.mobile">{{infos.mobile|cardMessage}}</text>
					<image src="../../static/image/arrow-right.png" mode=""></image>
				</view>
			</view>
			<view  class="setting-list flex flai fljcsb" @click="bindBank()">
				<view class="setting-title">
					银行卡
				</view>
				<view class="setting-con flex flai">
					<text>{{infos.bankName}}<text v-if="bankCardNos">[{{bankCardNos}}]</text></text>
					<image src="../../static/image/arrow-right.png" mode=""></image>
				</view>
			</view>
		</view>
		<view class="setting-box">
			<view  class="setting-list flex flai fljcsb" @click="question()">
				<view class="setting-title">
					常见问题
				</view>
				<view class="setting-con flex flai">
				
					<image src="../../static/image/arrow-right.png" mode=""></image>
				</view>
			</view>
			<navigator url="" class="setting-list flex flai fljcsb">
				<view class="setting-title">
					下载APP
				</view>
				<view class="setting-con flex flai">
	
					<image src="../../static/image/arrow-right.png" mode=""></image>
				</view>
			</navigator>
			<!-- url="/pages/myMutualHelp/isSatisfaction" -->
			<navigator style="border-bottom: 2rpx solid rgba(238,238,238,1)"  class="setting-list flex flai fljcsb">
				<view class="setting-title">
					满意度调查
				</view>
				<view class="setting-con flex flai">
				
					<image src="../../static/image/arrow-right.png" mode=""></image>
				</view>
			</navigator>
			<view class="setting-list flex flai fljcsb" @click="call">
				<view class="setting-title">
					客服热线
				</view>
				<view class="setting-con flex flai" style="color:#3CC200">400-659-8150</view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from '../../api/index.js';
	export default {
		data() {
			return {
				infos:{},//个人设置信息
				bankCardNos:'',//银行卡号截取使用
			}
		},
		onShow() {
			this.getList()
		},
		methods: {
	        // 获取个人信息
	        getList () {
	        	api.wxAuth.getWxUserInfo().then(res=>{
	        		if (res.code == 1) {
	        			this.infos = res.data;
						let str=res.data.bankCardNo
						let bankCardNos=str.substring(str.length-4);
						this.bankCardNos=bankCardNos;
	        		}
	        	})
	        },
			// 绑定手机号跳转
			bindMobile(){
				uni.navigateTo({
					 url: '/pages/myMutualHelp/newMobile'
				})
			},
			//  绑定银行卡
			bindBank(){
				if(!this.infos.bankCardNo){
					uni.navigateTo({
						 url: '/pages/myMutualHelp/bindBank'
					})
				}else{
					uni.navigateTo({
						 url: '/pages/myMutualHelp/bindBanknone'
					})
				}
			},
			// 常见问题
			question(){
			   uni.navigateTo({
			   	url:"/pages/myMutualHelp/normalQuestion"
			   })	
			},
			// 打电话
			call () {
				uni.makePhoneCall({
				    phoneNumber: '400-659-8150' 
				});
			}
		}
	}
</script>

<style>
	@import "../../static/css/common.css";
	@import url("./myMutualHelp.css");
</style>

